Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update billing address migration tasks with batch limit #4104

Merged

Conversation

spaghetticode
Copy link
Member

Description

When running the task on large DBs it makes sense to limit the number of records updated on each transaction in order to avoid locking the records (or the whole table) for too long.

The default batch size is 100'000 and it can be overridden by passing a different value when invoking the task. For example,
this will set the batch size to 1000 rows:

rake solidus:migrations:migrate_default_billing_addresses_to_address_book:up[1000]

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

@spaghetticode spaghetticode force-pushed the migrate-addresses-in-batches branch from 034c851 to bcaff67 Compare June 18, 2021 13:35
When running the tasks on large DBs it makes sense to limit the
number of records updated on each transaction in order to avoid
locking the records (or the whole table) for too long.

The default batch size is 100'000 and it can be overridden by
passing a different value when invoking the tasks. For example,
this will set the batch size to 1000 rows:

rake solidus:migrations:migrate_default_billing_addresses_to_address_book:up[1000]
@spaghetticode spaghetticode force-pushed the migrate-addresses-in-batches branch from bcaff67 to 45c364b Compare June 18, 2021 13:47
@spaghetticode spaghetticode marked this pull request as ready for review June 18, 2021 14:01
@spaghetticode spaghetticode self-assigned this Jun 18, 2021
@spaghetticode spaghetticode added the type:enhancement Proposed or newly added feature label Jun 18, 2021
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Andrea!

@kennyadsl kennyadsl merged commit bc73004 into solidusio:v2.11 Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants